/* main.c -- main file of EngCur
 *
 * Time-stamp: <2007-06-24 06:31:16 BRT Diogo F. S. Ramos>
 *
 *
 */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <gtk/gtk.h>
#include <glade/glade.h>

#include "../includes/support.h"
#include "../includes/debug_funcs.h"
#include "../includes/interfaces.h"

int
main( int argc, char *argv[] )
{
    /* Initiating rand() */
    srand( time(NULL) );
    
    if( argc > 1 )
    {
	if( !strcmp(argv[1], "-d") )
	{
	    debug();
	    exit(0);
	}
    }

    GladeXML *xmlTree;
    GtkWidget *main_window;
    gtk_init(&argc, &argv);

    /* Initiating semester. Trying at all cost not to use
     * globals. Just a obsession, what can I do? */
    semester *sem;
    sem = semester_new();
    
    xmlTree = glade_xml_new ("gui.glade", NULL, NULL);

    main_window = initial_setup (xmlTree, sem);

    g_object_unref( xmlTree );
    
    gtk_widget_show(main_window);
    
    gtk_main();
    
    return EXIT_SUCCESS;    
}

